<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="/pages/public/head.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">


		<title>四维测-手册修改</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link href="css/style_right.css" type="text/css" rel="stylesheet" />
		<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>

		<script type="text/javascript">
	//picture/picture_replacePicture?handBook.id=${handBook.id}&picture.fileDir=${pic.fileDir}
	function replacePicture(bookId, fileDir, picId) {
		$("input[type=hidden]", $("#form")).each(function() {
			this.remove();
		});
		var url = "picture/picture_replacePicture";
		$("<input/>", {
			type : "hidden",
			name : "handBook.id",
			val : bookId
		}).appendTo("#form");
		$("<input/>", {
			type : "hidden",
			name : "picture.fileDir",
			val : fileDir
		}).appendTo("#form");

		$("<input/>", {
			type : "hidden",
			name : "picture.id",
			val : picId
		}).appendTo("#form");
		$("#form").attr("action", url);
		$("#form").submit();
	}
	
	
	function replaceIcon(bookId, fileDir, picId) {
		$("input[type=hidden]", $("#form")).each(function() {
			this.remove();
		});
		var url = "picture/picture_replaceIcon";
		$("<input/>", {
			type : "hidden",
			name : "handBook.id",
			val : bookId
		}).appendTo("#form");
		$("<input/>", {
			type : "hidden",
			name : "picture.fileDir",
			val : fileDir
		}).appendTo("#form");

		$("<input/>", {
			type : "hidden",
			name : "picture.id",
			val : picId
		}).appendTo("#form");
		$("#form").attr("action", url);
		$("#form").submit();
	}
</script>

		<style type="text/css">
<!--
.bookInfo {
	height: 150px;
	width: 1000px;
	padding-top: 5px;
	padding-right: 5px;
	padding-bottom: 5px;
	padding-left: 60px;
}

.pics ul li {
	float: left;
	padding: 5px;
}

.pics {
	overflow: auto;
	padding: 5px;
	clear: both;
}

li {
	list-style-type: none;
	padding-top: 10px;
}

.bookInfo .t_left {
	width: 300px;
	height: 130px;
	float: left;
}

.bookInfo .t_right {
	float: right;
	width: 700px;
	height: 130px;
}

.pics .til {
	padding-left: 60px;
}

.li_pic {
	overflow: auto;
	background-color: #000;
	padding-left: 60px;
}
-->
</style>

	</head>

	<body>
	
		
						
						
					
		<form id="form" action="" method="post"></form>

		<!--============ right view start================== -->
		<div class="right">
			<div class="userL">
				<li class="e1">
					<p>
						<a
							href="<%=basePath%>books/books_bookList?handBook.userId=${handBook.userId}">手册列表</a>》内容修改
					</p>
				</li>
			</div>
			<form action="<%=basePath%>books/books_updateBook" method="post">

				<!-- *************bookInfo  start************** -->
				<div class="bookInfo">
					<input name="handBook.userId" value="${handBook.userId}" type="hidden"> 
					<input name="user.userName" value="${user.userName}" type="hidden">
					<input name="handBook.id" value="${handBook.id}" type="hidden">
					<div class="t_left">
						<ul>
							<li>
								手册名称：
								<input name="handBook.name" value="${handBook.name}">
							</li>
							<li>
								作者名称：
								<input name="handBook.author" value="${handBook.author}">
							</li>
						</ul>
					</div>
					<div class="t_right">
						<s:iterator status="indexs" value="pictures" var="pic">
							<s:if test="#pic.type == 'icon'">
								<a
									href="javascript:replaceIcon('${handBook.id}','${pic.fileDir}','${pic.id}');">
									<img alt="" title="手册图标"
										src="${httpImage}/${pic.fileDir}?<%=System.currentTimeMillis()%>" />
								</a>
							</s:if>
						</s:iterator>
						
						
					</div>
					<input type="submit" value="提交">
				</div>
				<!-- *************bookInfo  end************** -->

				<!-- **********pics start************ -->
				<div class="pics">
			
			 <c:if test="${prompt != null}">
					${prompt}请您<a href="">上传内容图片</a>
             </c:if>
			 
			 
					<div class="til">
						<p>
							内容图片：(点击进入修改)
						</p>
					</div>
					<div class="li_pic">
						<ul>
							<s:iterator status="indexs" value="pictures" var="pict">
								<s:if test="#pict.type == 'content'">
									<li>
										<a
											href="javascript:replacePicture('${handBook.id}','${pict.fileDir}','${pict.id}');">
											<img alt="" title="第${indexs.index}页"
												src="${httpImage}/${pict.fileDir}?<%=System.currentTimeMillis()%>"
												width="183" height="137" /> </a>
									</li>
								</s:if>
							</s:iterator>
						</ul>
					</div>
				</div>
				<!-- **********pics end************ -->
			</form>
		</div>
		<!--============ right view end================== -->
	</body>
</html>
